package Demo03;

public class Main01 {
    public static void main(String[] args) {
        Object o1 = new Object();
        Thread t1 = new Thread(() -> {
            try {
                o1.wait();
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("t1等待结束");
        });
        Thread t2 = new Thread(() -> {
            try {
                Thread.sleep(3000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            o1.notify();
        });

        t1.start();
        t2.start();
    }
}
